<?php if ($this instanceof UserProfileController) { ?>
    <div class="form">


        <?php
        $form = $this->beginWidget('GxActiveForm', array(
            'id' => 'user-profile-form',
            'enableAjaxValidation' => true,
        ));
        ?>

        <p class="note">
            <?php echo Yii::t('app', 'Fields with'); ?> <span class="required">*</span> <?php echo Yii::t('app', 'are required'); ?>.
        </p>

        <?php
        echo $form->errorSummary($model);
    }
    ?>
    <div class="row">
        <div class="rowLabel"><?php echo $form->labelEx($model, 'first_name'); ?>
        </div>
        <div class="rowControl"><?php echo $form->textField($model, 'first_name', array('class' => 'input-xlarge')); ?>
            <?php echo $form->error($model, 'first_name'); ?>
        </div><!-- row -->
    </div>

    <div class="row">
        <div class="rowLabel"><?php echo $form->labelEx($model, 'last_name'); ?>
        </div>
        <div class="rowControl"><?php echo $form->textField($model, 'last_name', array('maxlength' => 45, 'class' => 'input-xlarge')); ?>
            <?php echo $form->error($model, 'last_name'); ?>
        </div><!-- row -->
    </div>
    <div class="row">
        <div class="rowLabel"><?php echo $form->labelEx($model, 'date_of_birth'); ?>
        </div>
        <div class="rowControl">
            <?php
            $this->widget('zii.widgets.jui.CJuiDatePicker', array(
                'model' => $model,
                'attribute' => 'date_of_birth',
                'value' => ($model->date_of_birth == '') ? date('d-m-Y') : $model->date_of_birth,
                'options' => array(
                    'dateFormat' => 'yy-mm-dd',
                    'showAnim' => 'slide', //'slide','fold','slideDown','fadeIn','blind','bounce','clip','drop'
                    'changeMonth' => true,
                    'changeYear' => true,
                    'yearRange' => '2000:2099',
                    'minDate' => '1950-01-01', // minimum date
                    'maxDate' => "+0D",
                ),
                'htmlOptions' => array(
                    'class' => 'input-xlarge'
                ),
            ));
            ?>

            <?php echo $form->error($model, 'date_of_birth'); ?>
        </div><!-- row -->
    </div>

    <div class="row">
        <div class="rowLabel"><?php echo $form->labelEx($model, 'phone'); ?>
        </div>
        <div class="rowControl"><?php echo $form->textField($model, 'phone', array('maxlength' => 45, 'class' => 'input-xlarge')); ?>
            <?php echo $form->error($model, 'phone'); ?>
        </div><!-- row -->
    </div>

    <div class="row">
        <div class="rowLabel"><?php echo $form->labelEx($model, 'photo'); ?>
        </div>
        <div class="rowControl" style="margin-bottom: 10px;"><?php echo $form->fileField($model, 'photo', array('class' => 'btn', 'style' => 'width:256px')); ?>
            <?php echo $form->error($model, 'photo'); ?>
        </div>  
    </div>
    <div class="row" style="margin-bottom: 10px;">
        <div class="rowLabel">&nbsp;
        </div>
        <div class="rowControl" >
            <?php
            if (!$model->isNewRecord) {
                echo '<img src="' . baseUrl() . '../../' . getUploadDirBackend() . getLoginUserId() . '/profile/thumb/' . $model->photo . '">';
            }
            ?>
        </div>   </div>   


    <div class="row">
        <div class="rowLabel"><?php echo $form->labelEx($model, 'address_line1'); ?>
        </div>
        <div class="rowControl"><?php echo $form->textField($model, 'address_line1', array('maxlength' => 45, 'class' => 'input-xlarge')); ?>
            <?php echo $form->error($model, 'address_line1'); ?>
        </div><!-- row -->
    </div>

    <div class="row">
        <div class="rowLabel"><?php echo $form->labelEx($model, 'address_line2'); ?>
        </div>
        <div class="rowControl"><?php echo $form->textField($model, 'address_line2', array('maxlength' => 45, 'class' => 'input-xlarge')); ?>
            <?php echo $form->error($model, 'address_line2'); ?>
        </div><!-- row -->
    </div>

    <div class="row">
        <div class="rowLabel"><?php echo $form->labelEx($model, 'street'); ?>
        </div>
        <div class="rowControl"><?php echo $form->textField($model, 'street', array('maxlength' => 45, 'class' => 'input-xlarge')); ?>
            <?php echo $form->error($model, 'street'); ?>
        </div><!-- row -->
    </div>
    <div class="row">
        <div class="rowLabel"><?php echo $form->labelEx($model, 'zip_code'); ?>
        </div>
        <div class="rowControl"><?php echo $form->textField($model, 'zip_code', array('maxlength' => 45, 'class' => 'input-xlarge')); ?>
            <?php echo $form->error($model, 'zip_code'); ?>
        </div><!-- row -->
    </div>

    <div class="row">
        <div class="rowLabel"><?php echo $form->labelEx($model, 'about'); ?>
        </div>
        <div class="rowControl"><?php echo $form->textArea($model, 'about', array('class' => 'input-xlarge')); ?>
            <?php echo $form->error($model, 'about'); ?>
        </div><!-- row -->
    </div>
   
    <div class="row">
        <div class="rowLabel"><?php echo $form->labelEx($model, 'experience'); ?>
        </div>
        <div class="rowControl"><?php echo $form->textArea($model, 'experience', array('class' => 'input-xlarge')); ?>
            <?php echo $form->error($model, 'experience'); ?>
        </div><!-- row -->
    </div>
    <div class="row">
        <div class="rowLabel"><?php echo $form->labelEx($model, 'other_info'); ?>
        </div>
        <div class="rowControl"><?php echo $form->textArea($model, 'other_info', array('class' => ' other_info')); ?>
            <?php echo $form->error($model, 'other_info'); ?>
        </div><!-- row -->
    </div>


    <?php if ($this instanceof UserProfileController) { ?>    

        <div class="row">
            <?php
            echo GxHtml::submitButton(Yii::t('app', 'Save'));
            $this->endWidget();
            ?>
        </div>
    </div>
    <!-- form -->
    <?php
}?>